package com.veterinaria.actions;

import java.util.ArrayList;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;

import com.opensymphony.xwork2.ActionSupport;
import com.veterinaria.bean.AreaBean;
import com.veterinaria.services.AreaImplements;

@ParentPackage(value="ProyVeterinaria")
public class AreaAction extends ActionSupport{
	
	AreaImplements areaImp=new AreaImplements();
	private ArrayList<AreaBean> listaArea;
	
	@Action( value="JSONCargarArea",results={@Result(name="success",type="json")})
	public String cargarArea() throws Exception{
		setListaArea(areaImp.listarAreas());
		return SUCCESS;
	}

	public ArrayList<AreaBean> getListaArea() {
		return listaArea;
	}

	public void setListaArea(ArrayList<AreaBean> listaArea) {
		this.listaArea = listaArea;
	}

}
